package com.sinya.shoppingmall.utils;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

/**
 * @author KoizumiSinya
 * @date 2016/1/14.
 */
public class IntoUtils {

    public static void goActivity(Context context, Bundle bundle, Class<?> ac) {
        Intent intent = new Intent(context, ac);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }

    public static void goActivity(Context context, int intentFlag, Bundle bundle, Class<?> ac){
        Intent intent = new Intent(context, ac);
        intent.putExtras(bundle);
        intent.setFlags(intentFlag);
        context.startActivity(intent);
    }

    public static void goActivity(Context context, int intentFlag, Class<?> ac) {
        Intent intent = new Intent(context, ac);
        intent.setFlags(intentFlag);
        context.startActivity(intent);
    }

    public static void goActivity(Context context, Class<?> ac) {
        Intent intent = new Intent(context, ac);
        context.startActivity(intent);
    }

    public static void goActivityForResult(Activity activity, Class<?> ac,  int ADDRESS_ADD_REQUEST_CODE) {
        Intent intent = new Intent(activity, ac);
        activity.startActivityForResult(intent, ADDRESS_ADD_REQUEST_CODE);
    }
}
